package com.mxpio.erp.common.equipment.entity;

import com.fasterxml.jackson.annotation.JsonFormat;
import com.mxpioframework.jpa.annotation.Generator;
import com.mxpioframework.security.annotation.Dict;
import com.mxpioframework.security.entity.BaseEntity;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import lombok.EqualsAndHashCode;

import javax.persistence.*;
import java.util.Date;


/**
 * 保养计划目标对象 MB_ERP_EQUIPMENT_UPKEEP_PLAN_TARGET
 *
 * @author Cheng
 * @date 2023-07-19
 */
@Data
@EqualsAndHashCode(callSuper=false)
@Entity
@Table(name = "MB_ERP_EQUIPMENT_UPKEEP_PLAN_TARGET")
@Schema(description="保养计划目标")
public class EquipmentUpkeepPlanTarget extends BaseEntity {

private static final long serialVersionUID=1L;

    @Id
    @Generator
    @Column(name = "ID_")
    @Schema(description = "主键")
    private String id;

    @Column(name = "CHECK_TYPE_")
    @Schema(description = "保养类别")
    private String checkType;

    @Column(name = "TARGET_ID_")
    @Schema(description = "保养目标")
    private String targetId;

    @Column(name = "PLAN_ID_")
    @Schema(description = "保养计划ID")
    private String planId;

    @Column(name = "TARGET_NAME_")
    @Schema(description = "目标名称")
    private String targetName;

    @Column(name = "TARGET_CODE_")
    @Schema(description = "目标编码")
    private String targetCode;

    @Column(name = "TARGET_SPEC_")
    @Schema(description = "目标规格")
    private String targetSpec;

    @Column(name = "UPKEEP_GROUP_CODE_")
    @Schema(description = "保养群组")
    @Dict(dicCode="groupCode", dicEntity = EquipmentPersonGroup.class, dicText = "groupName")
    private String upkeepPersonGroupCode;

    @Column(name = "LAST_UPKEEP_DATE_")
    @Schema(description = "上次保养日期")
    @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
    private Date lastUpkeepDate;//上次保养日期

    @Column(name = "LAST_PLAN_START_")
    @Schema(description = "上次计划开始时间")//循环执行时 计算使用
    @JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss")
    private Date lastPlanStart;

    @Transient
    private String categoryId;

    @Transient
    private EquipmentEqpBasics eqpBasics;//目标设备


}
